using System;
using System.Web.Services.Protocols;

namespace Thinktecture.Tools.Web.Services.Extensions
{
	[AttributeUsage(AttributeTargets.Method)]
	public sealed class ValidationAttribute : SoapExtensionAttribute
	{
		private string xmlNamespace;
		private string schemaLocation;
		private int priority;
		
		/// <summary>
		/// Gets or sets the namespace.
		/// </summary>
		/// <value></value>
		public string Namespace
		{
			get { return xmlNamespace; }
			set { xmlNamespace = value; }
		}

		/// <summary>
		/// Gets or sets the schema location.
		/// </summary>
		/// <value></value>
		public string SchemaLocation
		{
			get { return schemaLocation; }
			set { schemaLocation = value; }
		}

		/// <summary>
		/// Creates a new <see cref="ValidationAttribute"/> instance.
		/// </summary>
		public ValidationAttribute() {}

		/// <summary>
		/// Creates a new <see cref="ValidationAttribute"/> instance.
		/// </summary>
		/// <param name="ns">Ns.</param>
		/// <param name="schemaLoc">Schema loc.</param>
		public ValidationAttribute(string ns, string schemaLoc) 
		{
			this.Namespace = ns;
			this.SchemaLocation = schemaLoc;
		}

		/// <summary>
		/// Gets the extension type.
		/// </summary>
		/// <value></value>
		public override Type ExtensionType
		{
			get { return typeof(ValidationExtension); }
		}

		/// <summary>
		/// Gets or sets the priority.
		/// </summary>
		/// <value></value>
		public override int Priority
		{
			get { return priority; }
			set { priority = value; }
		}
	}

}
